package com.copm.demonstrationsystem.dao.introductionfeatures;

import com.copm.demonstrationsystem.pojo.introductionfeatures.CompanyDevelopHistory;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import org.w3c.dom.stylesheets.LinkStyle;

import java.util.List;

@Repository
public interface CompanyDevelopHistoryDao extends JpaRepository<CompanyDevelopHistory, Long> {

    @Query(value = "select * from company_develop_history", nativeQuery = true)
    List<CompanyDevelopHistory> findPage();

    @Query(value = "select MAX(c.id) from company_develop_history c ", nativeQuery = true)
    Long findMaxId();

    @Query(value = "select * from company_develop_history where begin=?1", nativeQuery = true)
    List<CompanyDevelopHistory> findByBegin(Long begin);

    List<CompanyDevelopHistory> findByBeginNull();

//    @Query(value = " select top 1 id from company_develop_history order by id desc", nativeQuery = true)
//    Long findMaxId();
//
//    CompanyDevelopHistory findTopById();

}
